var question_btn = document.getElementsByClassName("question")[0];
var answer_btn = document.getElementsByClassName("answer")[0];

//点击我要提问按钮
question_btn.onclick = function(){//验证是否登录
	$.ajax({
		type:'post',
		url:'/citrusmonitor/question.do?method=loadStatus',//后台填充URL
		dataType:'json',
		success:function(data){
			if(data == 1){
				window.location.href = "question.html";//提问页面
			}else{
				alert("请先登录！");
				window.location.href = "/citrusmonitor/back-stage/user/login.html";//登录页面页面
			}
		},
		error:function(){
			alert("出错了，请重试!");
		}
	});
}


answer_btn.onclick = function(){//验证是否登录
	$.ajax({
		type:'post',
		url:'/citrusmonitor/answer.do?method=loadStatus',//后台填充URL
		dataType:'json',
		success:function(data){
			if(data == 1){
				window.location.href = "question_ul_exp.html";//未回答的问题列表页面
			}else{
				alert("请先登录！");
				window.location.href = "/citrusmonitor/back-stage/expert/login.html";//登录页面页面
			}
		},
		error:function(){
			alert("出错了，请重试!");
		}
	});
}
